﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true"
    CodeBehind="FacilityLookup.aspx.cs" Inherits="MockPrjTeam1.Pages.Views.FacilityLookup" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <div id="templatemo_main">
        <div style="color: #000000; font-weight: bold">
            <br />
            <table class="tablesort">
                <tr>
                    <td class="style12">
                        FirstName
                    </td>
                    <td class="style12b">
                        <asp:TextBox ID="txtFirstName" runat="server" CssClass="textbox" TabIndex="1"></asp:TextBox>
                    </td>
                    <td class="style12">
                        SurName
                    </td>
                    <td class="style12b">
                        <asp:TextBox ID="txtSurName" runat="server" CssClass="textbox" TabIndex="2"></asp:TextBox>
                    </td>
                </tr>
            </table>
            <br />
            <table>
            
                <tr>
                    <td>
                        <asp:Button ID="btnSearchContact2" Text="Search Contact" runat="server" Width="120px"
                            Height="25px" OnClick="btnSearchContact2_Click" />
                    </td>
                </tr>
            </table>
            </div>
                   <asp:GridView ID="grvFacilityLookupContact" Width="800px" runat="server" AllowPaging="True"
            AutoGenerateColumns="False" Style="margin-top: 0px" ShowHeaderWhenEmpty="True"
            OnPageIndexChanging="grvFacilityLookupContact_PageIndexChanging" OnSelectedIndexChanged="grvFacilityLookupContact_SelectedIndexChanged"
            EnableModelValidation="True" OnPageIndexChanged="grvFacilityLookupContact_SelectedIndexChanged" DataKeyNames="ContactID">
            <Columns>
                <asp:TemplateField HeaderText="">
                    <ItemTemplate>
                        <center>
                            <input type="radio" class="selectradio" id='<%# Eval("ContactID") %>' name='SuppliersGroup' value='<%# Eval("ContactName") %>'/></center>
                            
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ContactName" HeaderText="Contact Name" SortExpression="ContactName">
                    <ControlStyle BorderColor="White" />
                    <FooterStyle BackColor="White" />
                </asp:BoundField>
                <asp:BoundField DataField="MobilePhone" HeaderText="Mobile Phone" SortExpression="MobilePhone" />
                <asp:BoundField DataField="EmailAddress" HeaderText="Email Address" SortExpression="EmailAddress" />
                <asp:BoundField DataField="ContactType" HeaderText="Contact Type" SortExpression="ContactType" />
                <asp:BoundField DataField="Active" HeaderText="Is Active" SortExpression="Active" />
            </Columns>
        </asp:GridView>
            <br />
            <table>
                <tr>
                    <td>
                      
                        <input type='button' value='Select' onclick="javascript: return getSelectedItem();" width="65px" height="25" />
                      
                    </td>
                </tr>
            </table>
        </div>
        <script type='text/javascript'>
            function getSelectedItem() {
                var radioes = document.getElementsByClassName('selectradio');
                for (var i = 0; i < radioes.length; i++) {
                    if (radioes[i].checked) {                       
                        window.opener.GetValueFromChild(radioes[i].value);
                        window.close();
                        return false;
                        
                    }
                }
            }

            function getSelectedItem2() {
                var radioes = document.getElementsByClassName('selectradio');
                for (var i = 0; i < radioes.length; i++) {
                    if (radioes[i].checked) {
                        //alert(radioes[i].id,radioes[i].valueOf);
                        window.opener.GetValueFromChid(radioes[i].value);
                        window.close();
                        return false;
                    }
                }
            }
        </script>
</asp:Content>
